
def enc(text):
    text_enc = ''
    for c in text:
        if ord(c) >= ord('a') and ord(c) <= ord('z'):
            text_enc += chr((ord(c)+3-ord('a'))%26+ord('a'))
        elif ord(c) >= ord('A') and ord(c) <= ord('Z'):
            text_enc += chr((ord(c) + 3 - ord('A')) % 26 + ord('A'))
        else:
            text_enc += c
    return text_enc

def dec(text):
    text_dec = ''
    for c in text:
        if ord(c) >= ord('a') and ord(c) <= ord('z'):
            text_dec += chr((ord(c) - 3 - ord('a')) % 26 + ord('a'))
        elif ord(c) >= ord('A') and ord(c) <= ord('Z'):
            text_dec += chr((ord(c) - 3 - ord('A')) % 26 + ord('A'))
        else:
            text_dec += c
    return text_dec

plain_text = input('请输入明文（英文）:\n')
text_enc = enc(plain_text)
print(text_enc)
text_dec = dec(text_enc)
print(text_dec)